-+-    Example 2 for DB Dumper for PROGRESS  *  Copyright (C) JP 2oo6    -+-

GOAL:
=====
  Extract data from PROGRESS database to text file with external program.

COMPONENTS:
===========
  Database: PROGRESS 9.1D
  ODBC Driver: DataDirect 4.1 SQL92 ODBC (i think it's in 91D_Win32_Patch09 pack)

STEPS:
======
  1) Install ODBC driver

  2) Add to ODBC Data Source Administrator / System DNS your
     configuration. See picture odbc1.gif and odbc2.gif

  3) Be sure that server is running ok. I use to connect this string:
     DSN=example;DATABASE=DBN;UID=USER;PWD=PASSWD
     You can modify it to your connect details.

  4) Create script with tables to extract. All tables must be beginning with
     PUB. prefix. (Check Script_2.txt)

FAQ:
====
- You get: Access Denied (Authorization failed) message

  Fix:
  1) Open the SQL Explorer and connect as 'sysprogress'
  
  2) Grant DBA privilege to the desired user:
        GRANT SELECT ON pub.customer TO user; (user can read customer table)
        GRANT ALL ON pub.customer TO user;  (user can read, update customer)
        GRANT SELECT ON pub.customer TO public; (all users can read customer, it's public)
        COMMIT;

  3) Other things that can help in this problem:
     You can list your DBA rights with
        SELECT * FROM sysprogress.sysdbauth
  
     If you want Add new user:
        CREATE USER user, password;
        COMMIT;

     If you want Add Admin rights to user:
        GRANT DBA TO 'user';
        COMMIT;

     If you want add access to all tables you can generate program that
     make for you script you just load to SQL explorer ...

        DEFINE STREAM S.
        OUTPUT STREAM S TO VALUE("Access.sql").
        FOR EACH _FILE WHERE _FILE._hidden = FALSE NO-LOCK:
          PUT STREAM S UNFORMATTED "GRANT ALL ON PUB." + _FILE._file-name + " TO YOUR_USER;" SKIP.
        END.
        PUT STREAM S UNFORMATTED "COMMIT; " Skip.
        OUTPUT STREAM S CLOSE.

     In SQL Explorer use File/Run File ... and select our output.
